package com.moxiao.yfjh.module.maker.dal.mysql.matchmakerInfo;

import com.moxiao.yfjh.module.maker.controller.admin.matchmakerInfo.vo.MatchmakerInfoExportReqVO;
import com.moxiao.yfjh.module.maker.controller.admin.matchmakerInfo.vo.MatchmakerInfoPageReqVO;
import com.moxiao.yfjh.module.maker.dal.dataobject.matchmakerInfo.MatchmakerInfoDO;
import java.util.*;

import com.moxiao.yfjh.framework.common.pojo.PageResult;
import com.moxiao.yfjh.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.moxiao.yfjh.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;
import com.moxiao.yfjh.module.maker.controller.admin.matchmakerInfo.vo.*;

/**
 * 相亲红娘信息 Mapper
 *
 * @author mx
 */
@Mapper
public interface MatchmakerInfoMapper extends BaseMapperX<MatchmakerInfoDO> {

    default PageResult<MatchmakerInfoDO> selectPage(MatchmakerInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MatchmakerInfoDO>()
                .eqIfPresent(MatchmakerInfoDO::getUserId, reqVO.getUserId())
                .eqIfPresent(MatchmakerInfoDO::getNo, reqVO.getNo())
                .likeIfPresent(MatchmakerInfoDO::getName, reqVO.getName())
                .eqIfPresent(MatchmakerInfoDO::getPhone, reqVO.getPhone())
                .eqIfPresent(MatchmakerInfoDO::getMerchantIntro, reqVO.getMerchantIntro())
                .eqIfPresent(MatchmakerInfoDO::getMerchantCover, reqVO.getMerchantCover())
                .eqIfPresent(MatchmakerInfoDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(MatchmakerInfoDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MatchmakerInfoDO::getId));
    }

    default List<MatchmakerInfoDO> selectList(MatchmakerInfoExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<MatchmakerInfoDO>()
                .eqIfPresent(MatchmakerInfoDO::getUserId, reqVO.getUserId())
                .eqIfPresent(MatchmakerInfoDO::getNo, reqVO.getNo())
                .likeIfPresent(MatchmakerInfoDO::getName, reqVO.getName())
                .eqIfPresent(MatchmakerInfoDO::getPhone, reqVO.getPhone())
                .eqIfPresent(MatchmakerInfoDO::getMerchantIntro, reqVO.getMerchantIntro())
                .eqIfPresent(MatchmakerInfoDO::getMerchantCover, reqVO.getMerchantCover())
                .eqIfPresent(MatchmakerInfoDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(MatchmakerInfoDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MatchmakerInfoDO::getId));
    }

}
